#pragma once

/***********************************************************************
* A square represent a vitual square in square pane which composes of
* many rows of square arrays
***********************************************************************/

#include "types.h"

class CDC;
class CLocalPane;

class CSquare
{
public:
	CSquare(CLocalPane* pSquarePane, CPoint pntLeftTop, UINT nSideWidth, bool bFlag = false, COLORREF color = RGB(0,0,0));
    ~CSquare();

    // Copy and assign
    //CSquare(const CSquare& square);
    //CSquare& operator=(const CSquare& square);

    // Draw and fill
	void Draw(CDC* pDC);
	void Draw(CDC* pDC, CPoint firstPoint, double fScale);

	void Fill(CDC* pDC);
	void Fill(CDC* pDC, CPoint firstPoint, double fScale);

    // Actions
    void GoDown();
	void GoLeft();
	void GoRight();

    // Attributes
    bool    GetFlag() const;
    void    SetFlag(bool bFlag);
    CPoint  GetLeftTop() const;
	void	SetLeftTop(const CPoint& point);
	CPoint	GetRightBottom() const;
    UINT    GetSideWidth() const;
	void	SetSideWidth(UINT nSideWidth);
    CRect   GetRect() const;
    void    SetRect(const CRect& rect);
	COLORREF GetColor() const;
	void	SetColor(COLORREF color);

    // Operators
    bool operator==(const CSquare& square);

private:
    CLocalPane *m_pSquarePane;     // Belong to
    CPoint      m_pntLeftTop;       // ID
    UINT        m_nSideWidth;       // Side width
    bool        m_bDrawFlag;        // To be draw or not
    CRect       m_rectSquare;       // Rectangle
    COLORREF	m_SquareColor;      // Color
};